<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *  厂家 用户表,  别名: 客户表
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->comment('厂家名称');
            $table->string('account')->unique()->comment('帐号');
            $table->string('email')->unique()->comment('邮箱');
            $table->string('password')->comment('密码');
            $table->string('package_id')->comment('套餐等级');
            $table->string('is_show')->default(1)->comment('是否启用(0不启用，1启用)');
            $table->string('is_order')->default(0)->comment('是否生成订单(0不生成，1生成)');
            $table->string('avatar')->default(null)->comment('用户头像');
            $table->string('weixin_openid')->nullable()->unique()->comment('微信openid');
            $table->string('weixin_unionid')->nullable()->unique()->comment('微信unionid');
            $table->timestamp('email_verified_at')->nullable()->comment('是否激活邮箱');
            $table->rememberToken()->comment('记住登陆');
            $table->softDeletes()->comment('软删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
